﻿using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Modularity;

namespace Linker.TaskCenter.EntityFrameworkCore
{
    [DependsOn(
        typeof(TaskCenterDomainModule),
        typeof(AbpEntityFrameworkCoreModule),
        typeof(AbpEntityFrameworkCoreMySQLModule)
    )]
    public class TaskCenterEntityFrameworkCoreModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            context.Services.AddAbpDbContext<TaskCenterDbContext>(options => { options.AddDefaultRepositories(true); });

            context.Services.Configure<AbpDbContextOptions>(options => { options.UseMySQL(); });
        }
    }
}